import { useState } from "react";
const Legacy = () => {
  const [count, setCount] = useState(0);

  return (
    <div>
      <h1>{count}</h1>
      <button
        onClick={() => {
          // setTimeout(() => {
          setCount(count + 1);
          setCount(count + 1);
          // setCount(count + 1)
          // setCount(count + 1)
          // setCount(count + 1)
          // setCount(count + 1)
          // }, 1000)
        }}
      >
        点我+1
      </button>
    </div>
  );
};
export default Legacy;
